namespace Aob.Lite.Dsl

import System

import Boo.Lang.Compiler
import Boo.Lang.Compiler.Ast

internal class BlockFinder(DepthFirstVisitor):
	private _annotationName as string
	private _blocks = []
	
	def constructor(annotationName as string):
		_annotationName = annotationName
	
	override def OnBlock(node as Block):
		super.OnBlock(node)
		if node.ContainsAnnotation(_annotationName):
			_blocks.Add(node)
	
	Blocks as (Block):
		get:
			return _blocks.ToArray(typeof(Block))

